package cn.ht.bootdemo.designmode.proxy.controller;

import cn.ht.bootdemo.common.entity.ResultVo;
import cn.ht.bootdemo.common.utils.R;
import cn.ht.bootdemo.designmode.proxy.service.impl.BuyHoseServiceImpl;
import cn.ht.bootdemo.designmode.proxy.service.impl.BuyHouseServiceProxy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ht
 * @Description:
 * @date 2020-5-13
 */
@RestController
public class ProxyTestController {

    @GetMapping("/testProxy")
    public ResultVo testBuyHose(long money){
        BuyHoseServiceImpl hoseService = new BuyHoseServiceImpl();
        BuyHouseServiceProxy serviceProxy = new BuyHouseServiceProxy(hoseService);
        serviceProxy.buyHouse(money);
        return R.success();
    }

}
